﻿/**********************************************************************
 * @file   FITKPHengLEISolverManager.h
 * @brief  求解器管理
 * @author WangKai (aurora_starry@outlook.com)
 * @date   2024-08-21
 *********************************************************************/
#ifndef _FITK___PHENGLEI____SOLVER_MANAGER__H___
#define _FITK___PHENGLEI____SOLVER_MANAGER__H___

#include "FITKInterfaceFlowPHengLEIAPI.h"
#include <functional>
#include <QStringList>
#include "FITK_Interface/FITKInterfaceFlowPHengLEI/FITKPHengLEIAbsSolver.h"
#include <QStringList>

namespace Interface
{
	class  FITKPHengLEIAbsSolver;
}

typedef std::function<Interface::FITKPHengLEIAbsSolver*()>  CREATEPHengLEISOLVERFUN;


namespace Interface
{
    /**
     * @brief  求解器信息 结构体
     * @author WangKai (aurora_starry@outlook.com)
     * @date   2024-08-21
     */
    struct FITKPHengLEISolverInfo
    {
        QString _solverName{};
        FITKPHengLEIAbsSolver::PHengLEISolverType _solverType{ FITKPHengLEIAbsSolver::PHengLEISolverType::PLSolverNone};
        QStringList _solverLabels{};
		CREATEPHengLEISOLVERFUN _createFuns{};
    };
    /**
     * @brief  求解器管理
     * @author WangKai (aurora_starry@outlook.com)
     * @date   2024-08-21
     */
    class FITKFlowPHengLEIAPI FITKPHengLEISolverManager
    {
    public:
        explicit FITKPHengLEISolverManager();
        virtual ~FITKPHengLEISolverManager();

        /**
         * @brief    获取求解器信息
         * @param[i] solverName 求解器名称
         * @return   FITKPHengLEISolverInfo
         * @author   WangKai (aurora_starry@outlook.com)
         * @date     2024-08-21
         */
        FITKPHengLEISolverInfo getSolverInfoBySolverName(QString solverName);

		QStringList getSolvers();

    private:
        /**
         * @brief    初始化求解器数据信息
         * @return   void
         * @author   WangKai (aurora_starry@outlook.com)
         * @date     2024-08-21
         */
        void initSolvers();
    
    private:
        /**
         * @brief  求解器数据信息
         * @author WangKai (aurora_starry@outlook.com)
         * @date   2024-08-21
         */
        QList<FITKPHengLEISolverInfo> m_solvers{};
    };
}


#endif
